package com.twu.biblioteca.entity;

import com.twu.biblioteca.common.UserRole;

/**
 * Created by ccsong on 9/23/14.
 */
public class User {
    private String libraryNumber;
    private String name;
    private String emailAddress;
    private String phoneNumber;
    private UserRole role;

    public User(String libraryNumber, String name, String emailAddress, String phoneNumber, UserRole role) {
        this.libraryNumber = libraryNumber;
        this.name = name;
        this.emailAddress = emailAddress;
        this.phoneNumber = phoneNumber;
        this.role = role;
    }

    public boolean isCustomer() {
        return getRole().equals(UserRole.Customer);
    }

    public boolean IsLiberian() {
        return getRole().equals(UserRole.Librarian);
    }

    public String getLibraryNumber() {
        return libraryNumber;
    }

    public String toString(){
        return "name : "+ name + ",\temail : " + emailAddress +",\tphoneNumber : "+phoneNumber+"\n";
    }

    public UserRole getRole() {
        return role;
    }
}
